import request from '@/utils/request'

export function queryStoreList(query) {
  return request({
    url: '/store/manage/queryStoreList',
    method: 'get',
    params: query
  })
}

//获取门店等级枚举值
export function getStoreGrade(query) {
  return request({
    url: '/store/manage/getStoreGrade',
    method: 'get',
    params: query
  })
}

// 获取上级门店
export function getParentStore(query) {
  return request({
    url: '/store/manage/getParentStore',
    method: 'get',
    params: query
  })
}
//平台新增门店数据
export function addStore(data) {
  return request({
    url: '/store/manage/addStore',
    method: 'post',
    data
  })
}
//查询关联用户端账号
export function queryRelateUserInfo(query) {
  return request({
    url: '/store/manage/queryRelateUserInfo',
    method: 'get',
    params: query
  })
} 

//删除门店数据
export function deleteStore(id) {
  return request({
    url: `/store/manage/deleteStore/${id}`,
    method: 'delete'
  })
}
// 门店详情
export function queryGoodsDetails(id) {
  return request({
    url: `/store/manage/detail/${id}`,
    method: 'get'
  })
}

// 更新数据
export function updateStore(data) {
  return request({
    url: '/store/manage/updateStore',
    method: 'put',
    data
  })
}


// 门店审核列表
export function queryAuditStoreList(query) {
  return request({
    url: '/store/manage/queryAuditStoreList',
    method: 'get',
    params: query
  })
}

//获取门店审核申请人信息
export function getApplyUserInfo(id) {
  return request({
    url: `/store/manage/getApplyUserInfo/${id}`,
    method: 'get'
  })
}

//审核门店
export function auditStoreInfo(data) {
  return request({
    url: '/store/manage/auditStoreInfo',
    method: 'put',
    data
  })
}

//门店详情
export function getDetailInfo(id) {
  return request({
    url: `/store/manage/detail/${id}`,
    method: 'get'
  })
}

//上下级门店
export function queryParentSonStore(query) {
  return request({
    url: '/store/manage/queryParentSonStore',
    method: 'get',
    params: query
  })
}

//核销记录
export function queryVerifyRecord(query) {
  return request({
    url: '/store/manage/queryVerifyRecord',
    method: 'get',
    params: query
  })
}

//佣金明细
export function queryStoreCommission(query) {
  return request({
    url: '/store/manage/queryStoreCommission',
    method: 'get',
    params: query
  })
}

// 余额流水
export function queryStoreBalanceFlow(query) {
  return request({
    url: '/store/manage/queryStoreBalanceFlow',
    method: 'get',
    params: query
  })
}